<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--easyui-->
		<script src="/static/__PUBLIC__/easyuitheme/easyui/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/static/__PUBLIC__/easyuitheme/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/static/__PUBLIC__/easyuitheme/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="/static/__PUBLIC__/easyuitheme/easyui/themes/gray/easyui.css" />
        <script type="text/javascript" src="/static/__PUBLIC__/js/json2.js"></script>
        <script type="text/javascript" src="/static/__PUBLIC__/js/common.js"></script>
		<!--字体图标-->
		<link rel="stylesheet" type="text/css" href="/static/__PUBLIC__/easyuitheme/easyui/themes/icons/css/font-awesome.min.css" />
		<!--皮肤-->
		<link rel="stylesheet" type="text/css" href="/static/__PUBLIC__/easyuitheme/css/superBlue.css" />
		<script type="text/javascript">
		/*easyui样式初始化*/
		$.fn.tabs.defaults.tabHeight = 32; //tab标签条高度
		$.fn.linkbutton.defaults.height = 32; //按钮高度
		$.fn.menu.defaults.itemHeight = 28; //menu高度

		$.fn.validatebox.defaults.height = 32;
		$.fn.textbox.defaults.height = 32;
		$.fn.textbox.defaults.iconWidth = 24;
		$.fn.datebox.defaults.height = 32;
		$.fn.numberspinner.defaults.height = 32;
		$.fn.timespinner.defaults.height = 32;
		$.fn.numberbox.defaults.height = 32;
		$.fn.combobox.defaults.height = 32;
		$.fn.passwordbox.defaults.height = 32;
		$.fn.filebox.defaults.height = 32;

		$.fn.menu.defaults.noline = true
		$.fn.progressbar.defaults.height = 18; //进度条
    var _menus = "";
        $(function (){
				if(userinfo){
					$("#usernameshow").text(userinfo.username);
					roletype = userinfo.roletype;
					if(roletype){
		                 if(roletype == "1"){
		                    $("#iframepage").attr("src","/static/user.html");
		                }else if(roletype == "3"){
		                    $("#iframepage").attr("src","/static/billshop.html");
		                }else if(roletype == "2"){
		                    //$("#iframepage").attr("src","xuanke.html");
                             window.location.href="/static/login.html";
		                }
		            }else{
					    window.location.href="/static/login.html";
                    }
				}else{
					window.location.href="/static/login.html";
				}
				
		        if (roletype) {
		            if (roletype == "1") {
		            	_menus = {
		              	         "menus": [

		              	                 {"menuid": "1", "icon": "icon-magic", "menuname": "厕所管理",
		              	                     "menus": [
		              	                         {"menuid": "12", "menuname": "厕所列表", "icon": "icon-database", "url": "/static/shop.html"}
		              	                     ]},
                                     {"menuid": "1", "icon": "icon-magic", "menuname": "评论反馈管理",
		              		   	                 "menus": [
		              		   	                     {"menuid": "12", "menuname": "评论反馈列表", "icon": "icon-database", "url": "/static/replay.html"}
		              		   	                 ]},

		              	   	           {"menuid": "1", "icon": "icon-magic", "menuname": "通知公告管理",
		              		   	                 "menus": [
		              		   	                     {"menuid": "12", "menuname": "通知公告列表", "icon": "icon-database", "url": "/static/notice.html"}
		              		   	                 ]},
		              	
		              	             {"menuid": "56", "icon": "icon-role", "menuname": "用户管理",
		              	                 "menus": [
		              	                     {"menuid": "31", "menuname": "用户列表", "icon": "icon-users", "url": "/static/user.html"}
		              	                 ]
		              	
		              	             }
		              	         ]};
		            }
		        }
		        
		        var menus = _menus.menus;
		        var html = "";
		        for(var i=0;i<menus.length;i++){
		        	var smenu = menus[i];
		        	var smenus = smenu.menus;
		        	for(var k=0;k<smenus.length;k++){
		        		var menu = smenus[k];
		        		html+="<li data-url='"+menu.url+"'>"+menu.menuname+"</li>";
		        	}
		        	
		        }
		        
		        $("#xitongmenu").html(html);
		        /*左侧导航分类选中样式*/
		    	$("#xitongmenu li").on('click', function() {
		    		$(this).siblings().removeClass('super-accordion-selected');
		    		$(this).addClass('super-accordion-selected');

		    		//新增一个选项卡
		    		var tabUrl = $(this).data('url');
		    		var tabTitle = $(this).text();
		    		//tab是否存在
		    		if($("#tt").tabs('exists', tabTitle)) {
		    			$("#tt").tabs('select', tabTitle);
		    		} else {
		    			$('#tt').tabs('add', {
		    				title: tabTitle,
		    				content: '<iframe src="'+tabUrl+'" width="100%" height="99%" frameborder="no"></iframe>',
		    				closable: true
		    			});
		    		}
		    	});
				

        	
        	
        	/*设置按钮的下拉菜单*/
        	$('.super-setting-icon').on('click', function() {
        		$('#mm').menu('show', {
        			top: 50,
        			left: document.body.scrollWidth - 130
        		});
        	});

        	/*修改主题*/
        	$('#themeSetting').on('click', function() {
        		var themeWin = $('#win').dialog({
        			width: 460,
        			height: 260,
        			modal: true,
        			title: '主题设置',
        			buttons: [{
        				text: '保存',
        				id: 'btn-sure',
        				handler: function() {
        					themeWin.panel('close');
        				}
        			}, {
        				text: '关闭',
        				handler: function() {
        					themeWin.panel('close');
        				}
        			}],
        			onOpen: function() {
        				$(".themeItem").show();
        			}
        		});
        	});
        	$(".themeItem ul li").on('click', function() {
        		$(".themeItem ul li").removeClass('themeActive');
        		$(this).addClass('themeActive');
        	});

        	/*退出系统*/
        	$("#logout").on('click', function() {
        		$.messager.confirm('提示', '确定退出系统？', function(r) {
        			if(r) {
        				console.log('确定退出')
						window.location.href="/static/login.html";
        			}
        		});
        	});
            
        });




        


    </script>
	</head>

	<body id="main" class="easyui-layout">
		<div data-options="region:'north',border:false" class="super-north" style="height: 50px;">
			<!--顶部-->
			<div class="super-navigation">
				<div class="super-navigation-title">后台管理系统</div>
				<div class="super-navigation-main">
					<div class="super-setting-left">
						<ul>
							<!-- <li><i class="fa fa-commenting-o"></i></li>
							<li><i class="fa fa-envelope-o"></i></li>
							<li><i class="fa fa-bell-o"></i></li> -->
							<!--<div id="mm2" class="easyui-menu">
								<div>有情况</div>
								<div>你瞅啥</div>
								<div class="menu-sep"></div>
								<div>瞅你咋滴</div>
							</div>-->
						</ul>
					</div>
					<div class="super-setting-right">
						<ul>
							<li class="user">
								<span class="user-icon"><img src="/static/__PUBLIC__/easyuitheme/img/favicon.png"/></span>
								<span id="usernameshow">管理员</span>
							</li>
							<li>
								<div class="super-setting-icon">
									<i class="fa fa-gears"></i>
								</div>
								<div id="mm" class="easyui-menu">
									<!-- <div>个人中心</div>
									<div id="themeSetting">主题</div> -->
									<div class="menu-sep"></div>
									<div id="logout">退出</div>
								</div>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div id="easyui-layout-west" data-options="region:'west',title:'主菜单',border:false">
			<!--左侧导航-->
			<div class="easyui-accordion" data-options="border:false,fit:true,selected:true">
				<div title="管理系统" data-options="iconCls:'fa fa-navicon'">
					<ul id="xitongmenu">
						<li data-url=''>用户管理</li>
					</ul>
				</div>
				
				<!-- <div title="布局" data-options="iconCls:'fa fa-desktop'" style="padding-left: 10px;">
					<div id="aaa" class="easyui-accordion" data-options="border:false,fit:true,selected:true">
						<div title="Title1" data-options="iconCls:'fa fa-sitemap'" style="padding-left: 10px;">
							<div id="aaa2" class="easyui-accordion" data-options="border:false,fit:true,selected:true">
								<div title="Title1" data-options="iconCls:'fa fa-sitemap'">
									<h3 style="color:#0099FF;">我是分类</h3>
								</div>
								<div title="Title2" data-options="iconCls:'fa fa-sitemap'">
									content2
								</div>
								<div title="Title3" data-options="iconCls:'fa fa-sitemap'">
									content3
								</div>
							</div>
						</div>
						<div title="Title2" data-options="iconCls:'fa fa-sitemap'">
							content2
						</div>
						<div title="Title3" data-options="iconCls:'fa fa-sitemap'">
							content3
						</div>
					</div>
				</div>
				<div title="菜单和按钮" data-options="iconCls:'fa fa-gavel'">
					content3
				</div>
				<div title="表单" data-options="iconCls:'fa fa-wpforms'">
					content3
				</div>
				<div title="窗口" data-options="iconCls:'fa fa-window-maximize'">
					content3
				</div>
				<div title="表格和树" data-options="iconCls:'fa fa-table'">
					content3
				</div>
				<div title="扩展" data-options="iconCls:'fa fa-sitemap'">
					content3
				</div> -->
			</div>
		</div>
		<div data-options="region:'center'" style="padding-top: 2px;">
			<!--主要内容-->
			<div id="tt" class="easyui-tabs" data-options="border:false,fit:true">
				<div title="首页" data-options="iconCls:'fa fa-home'">
					<iframe id="iframepage" src="" width="100%" height="99%" frameborder="no"></iframe>
				</div>
			</div>
		</div>
		<div data-options="region:'south'" class="super-south">
			<!--页脚-->
			<div class="super-footer-info">
				<span><i class="fa fa-info-circle"></i></span>
				<span><i class="fa fa-copyright"></i> <i class="fa fa-caret-right"></i></span>
			</div>
		</div>

		<!--主题设置弹窗-->
		<div id="win">
			<div class="themeItem">
				<ul>
					<li>
						<div class="TURQUOISE">TURQUOISE</div>
					</li>
					<li>
						<div class="EMERALD">EMERALD</div>
					</li>
					<li>
						<div class="PETER-RIVER">PETER RIVER</div>
					</li>
					<li>
						<div class="AMETHYST">AMETHYST</div>
					</li>
					<li>
						<div class="WET-ASPHALT">WET ASPHALT</div>
					</li>
					<li>
						<div class="SUN-FLOWER">SUN FLOWER</div>
					</li>
					<li>
						<div class="CARROT">CARROT</div>
					</li>
					<li class="themeActive">
						<div class="ALIZARIN">ALIZARIN</div>
					</li>
				</ul>
			</div>
		</div>

	</body>

</html>